<html>
<head>
<h1>View Accounts</h1>
</head>
<body>
<?php
	require "configcmd.php"; 
	$con = mysql_connect("localhost",$db_user ,$db_pass);
	if (!$con){
		die('Could not connect: ' . mysql_error());
   	 }
	mysql_select_db($db_name, $con);
	$sql_fetch = "Select * from Accounts"; 
	$result = mysql_query($sql_fetch); 
?>
<table border='1'>
<tr> 
<td><b>ID</b></td>
<td><b>Balance</b></td>
<td><b>Balance Limit</b></td>
<td><b>Status</b></td>

</tr>
<?php while($row = mysql_fetch_array($result)){
	echo "<tr>";
	echo "<td>" . $row['ID'] . "</td>";
	echo "<td>" . $row['Balance'] . "</td>";
	echo "<td>" . $row['Bal_limit'] . "</td>";
	echo "<td>" . $row['Status'] . "</td>";

	echo "<td><form method='POST' name='updateForm' action='editaccount.php'>
	<input type='hidden' name= 'ID' value=".$row['ID'].">
	<input type='submit' name='Edit' value='Edit'> 
   </form></td>";

	echo "</tr>";
}
	mysql_close($con);?>
</table>
<a href="main.php">Home</a>
</body>
</html>
